import request from '@/router/axios';

// 获取采购计划列表
export const getQuotationinfo = (current, size, params,supplierNo) => {
  return request({
    url: '/api/blade-portal/quotationinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
      supplierNo
    }
  })
}

// 保存报价单
export const saveQuotationInfo = (data) => {
  return request({
    url: '/api/blade-portal/quotationinfo/save',
    method: 'post',
    data: data
  })
}
// 更新报价单
export const updateQuotationInfo = (data) => {
  return request({
    url: '/api/blade-portal/quotationinfo/update',
    method: 'post',
    data: data
  })
}
//查看&编辑
export const detail = (quotationNo) => {
  return request({
    url: '/api/blade-portal/quotationinfo/detail',
    method: 'get',
    params: {
      quotationNo
    }
  })
}

// 删除
export const remove = (quotationNos) => {
  return request({
    url: '/api/blade-portal/quotationinfo/remove',
    method: 'post',
    params: {
      quotationNos,
    }
  })
}

// 改变状态
export const changeStatus = (quotationNos,state) => {
  return request({
    url: '/api/blade-portal/quotationinfo/changeQuotationStatus',
    method: 'post',
    params: {
      quotationNos,
      state
    }
  })
}

export const supplierPlants = (supplierNo) => {
  return request({
    url: '/api/blade-portal/quotationinfo/supplierPlants',
    method: 'get',
    params: {
      supplierNo
    }
  })
}
export const productDetail = (materialId,quotationNo) => {
  return request({
      url: '/api/blade-portal/quotationinfo/getMaterialCostAnalysis',
      method: 'get',
      params: {
        materialId,
        quotationNo
      }
  })
}
export const productSave = (data) => {
  return request({
      url: '/api/blade-portal/quotationinfo/updateMaterialCostAnalysis',
      method: 'post',
      data
  })
}
export const getInquireDetail = (inquiryNo) => {
  return request({
    url: '/api/blade-portal/quotationinfo/getInquiryInfoByNo',
    method: 'get',
    params: {
      inquiryNo
    }
  })
}

export const getPlants = (supplierNo) => {
  return request({
    url: '/api/blade-supplier-management/supplierinfo/plantList',
    method: 'get',
    params: {
      supplierNo
    }
  })
}